next up previous
Next: 2.2 Transparency Up: 2 Utility of Overlays Previous: 2 Utility of Overlays

2.1 Minimizing Screen Repaint Costs

Anyone familiar with X or most any other window system understands that programs must be able to ``repair'' damaged or freshly exposed regions of their windows. For most simple applications, regenerating a portion of a window is not very arduous. But the fact still remains that a significant share of compute cycles and graphics bandwidth is spent regenerating window contents.

The core X protocol supports a notion of backing store which can minimize the client costs of regenerating windows. But it greatly increases the X server's burden by asking the server to maintain in off-screen memory the contents of obscured or unmapped windows. A related core X protocol functionality known as save-unders saves the contents of windows obscured by a window using save-unders.

Overlay planes provide another means of minimizing window regeneration. It is notable that a significant amount of window damage is due to ``popping up'' transient windows such as pop-up or pull-down menus and dialog boxes. By creating such transient windows in the overlay planes, damage to underlying more permanent windows is avoided.

Notice that overlay planes gain advantage in the same way save-unders do. They both avoid damage to underlying windows.

But if we examine the two mechanisms closely, we see that overlay planes have some decided advantages over save-unders and backing store. First, because hardware is used to implement overlay planes, there is little overhead to using them. Backing store and save-unders both have high software overhead. For save-unders even though the client does not need to be aware that damage is happening to windows, the server must still save the pixels in the frame buffer and be ready to rewrite them back to the frame buffer. But in the overlay case, the pixels in the underlying window never need to be copied or redrawn even by the server.

Second, rendering to the obscured window while the window is still obscured can utilize the graphics hardware's faster rendering path instead of attempting to divert rendering into often slower off-screen pixmaps as backing store does.

Third, with modern graphics hardware, particularly hardware which supports 3D, the frame buffer holds much more information than just the pixel's color. It can also contain alpha buffer, accumulation buffer, stencil buffer, and depth buffer information. So called ``deep'' frame buffers magnify the costs of moving data off-screen then back into the frame buffer again. And in the case of direct hardware access graphics libraries, the server is not involved in the rendering making it impossible to effectively retain backing store for such windows.



next up previous
Next: 2.2 Transparency Up: 2 Utility of Overlays Previous: 2 Utility of Overlays



Mark Kilgard
Sun Jan 7 19:28:30 PST 1996